package priv.bruce.service;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import priv.bruce.entry.MovieScore;
import priv.bruce.util.HandlerSet;
import priv.bruce.util.JDBCUtil;

public class JudegeScore4DetailService {
	public List<MovieScore> JudegeScore(int mid,int uid) throws Exception{
		String sql="SELECT * from t_score where movie_id=? and user_id=?";

		return JDBCUtil.query(sql,new HandlerSet<MovieScore>(){
			@Override
			public MovieScore handler(ResultSet rs) throws SQLException {
				MovieScore movieScore = new MovieScore();
				movieScore.setMovie_id(rs.getInt("movie_id"));
				movieScore.setUser_id(rs.getInt("user_id"));
				movieScore.setScore_id(rs.getInt("score_id"));
				movieScore.setScore(rs.getInt("score"));
				return movieScore;
			}
		},mid,uid);
	}
}
